package com.laker.admin.module.ext.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.laker.admin.module.ext.entity.ExtDo;
import com.laker.admin.module.ext.mapper.ExtDoMapper;
import com.laker.admin.module.ext.service.IExtDoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Serializable;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author laker
 * @since 2024-03-20
 */
@Service
public class ExtDoServiceImpl extends ServiceImpl<ExtDoMapper, ExtDo> implements IExtDoService {
    @Resource
    private ExtDoMapper extDoMapper;

    @Override
    public <E extends IPage<ExtDo>> E page(E page, Wrapper<ExtDo> queryWrapper) {
        return extDoMapper.selectPage(page, queryWrapper);
    }

    @Override
    public boolean removeById(Serializable id) {
        return SqlHelper.retBool(extDoMapper.deleteById(id));
    }

    @Override
    public ExtDo getById(Serializable id) {
        return extDoMapper.selectById(id);
    }


    @Override
    public <E extends IPage<ExtDo>> E getTodoList(E page, Wrapper<ExtDo> queryWrapper) {
        return extDoMapper.selectTodoPage(page, queryWrapper);
    }

    @Override
    public <E extends IPage<ExtDo>> E getDoneList(E page, Wrapper<ExtDo> queryWrapper) {
        return extDoMapper.selectDonePage(page, queryWrapper);
    }
}
